cap log close
snapshot erase _all
clear all
estimates drop _all

*===========================*
*	Set Globals				*
*===========================*

	global filenum 31
	global filename "sum_tables"

*===========================*
*	Set Locals				*
*===========================*
		
	local outcomes 		"absent_paid"
	
	local sum_table		" female married age bachelors childUnder12 inlf unemp absent_paid "

	local sum_table1	"female married age bachelors childUnder12 absent_paid"
	
*===========================*
*	Load In Analysis File	*
*===========================*
	log using "${log_path}/${filenum}_${filename}.smcl", replace
	
	use "${data_path}/analysis_file.dta" , clear
	
	label define postlab 0 "2018-2019" 1 "2020"
	label values y2020 postlab
	
	** keep non-telework sample
	keep if tw_binary_10ly==0
	
	** keep control months
	keep if inlist(month,12,1,2,3)
	
	** keep control years
	keep if y2020==0
	
	label var female		"Female"
	label var married 		"Married"
	label var bachelors 	"Bachelors +"
	label var childUnder12	"Kids < 12"
	label var absent_paid	"Paid Absence"
	label var age			"Age"
	
	
snapshot save


*=======================*
*  Setup Table Columns	*
*	Large / Small		*
*	Pre 2020/ 2020		*
*=======================*

			
		#delimit ;
			eststo base:  
				estpost sum `sum_table1' [w=wtfinl], 
				meanonly;	
		
		
			eststo small:  
				estpost sum `sum_table1' if small==1 [w=wtfinl], 
				meanonly;	

			eststo large:  
				estpost sum `sum_table1' if small==0 [w=wtfinl], 
				meanonly;	
				
		#delimit cr
			
			
*=======================*
*  	  Create Tables		*
*=======================*		
		
	** CREATE TABLE **

		#delimit ;
			esttab base small large using "${out_path}/${filenum}_balance.tex", 
				mtitles label
				replace main(mean);
		#delimit cr


		